package com.imut.lagain.constant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 应用常量类
 */
public class AppConstants {
    private static final Logger log = LoggerFactory.getLogger(AppConstants.class);
    /** 系统名称 */
    public static final String SYSTEM_NAME = "LAgain";
    
    /** 系统版本 */
    public static final String SYSTEM_VERSION = "1.0.0";
    
    /** 默认页面大小 */
    public static final int DEFAULT_PAGE_SIZE = 10;
    
    /** 最大页面大小 */
    public static final int MAX_PAGE_SIZE = 100;
    
    /** 默认页码 */
    public static final int DEFAULT_PAGE_NUM = 1;
    /** JWT Token 过期时间（毫秒）- 7天 */
    public static final long JWT_EXPIRATION = 7 * 24 * 60 * 60 * 1000L;
    
    /** Refresh Token 过期时间（毫秒）- 30天 */
    public static final long REFRESH_TOKEN_EXPIRATION = 30 * 24 * 60 * 60 * 1000L;
    
    /** 验证码过期时间（毫秒）- 5分钟 */
    public static final long VERIFICATION_CODE_EXPIRATION = 5 * 60 * 1000L;
    
    /** 缓存过期时间（秒）- 1小时 */
    public static final long CACHE_EXPIRATION = 60 * 60L;
    
    /** 文件上传临时存储时间（毫秒）- 1小时 */
    public static final long TEMP_FILE_EXPIRATION = 60 * 60 * 1000L;
    /** 文件上传根目录 */
    public static final String UPLOAD_ROOT_PATH = "/uploads";
    
    /** 图片上传目录 */
    public static final String IMAGE_UPLOAD_PATH = "/uploads/images";
    
    /** 音频上传目录 */
    public static final String AUDIO_UPLOAD_PATH = "/uploads/audios";
    
    /** 视频上传目录 */
    public static final String VIDEO_UPLOAD_PATH = "/uploads/videos";
    
    /** 文档上传目录 */
    public static final String DOCUMENT_UPLOAD_PATH = "/uploads/documents";
    
    /** 临时文件目录 */
    public static final String TEMP_UPLOAD_PATH = "/uploads/temp";
    
    /** 最大文件大小（字节）- 10MB */
    public static final long MAX_FILE_SIZE = 10 * 1024 * 1024L;
    
    /** 最大图片大小（字节）- 5MB */
    public static final long MAX_IMAGE_SIZE = 5 * 1024 * 1024L;
    
    /** 最大音频大小（字节）- 20MB */
    public static final long MAX_AUDIO_SIZE = 20 * 1024 * 1024L;
    
    /** 最大视频大小（字节）- 50MB */
    public static final long MAX_VIDEO_SIZE = 50 * 1024 * 1024L;
    /** 胶囊分享码长度 */
    public static final int SHARE_CODE_LENGTH = 8;
    
    /** 胶囊标题最大长度 */
    public static final int CAPSULE_TITLE_MAX_LENGTH = 100;
    
    /** 胶囊描述最大长度 */
    public static final int CAPSULE_DESCRIPTION_MAX_LENGTH = 500;
    
    /** 记忆条目内容最大长度 */
    public static final int ENTRY_CONTENT_MAX_LENGTH = 2000;
    
    /** 用户最大胶囊数量 */
    public static final int MAX_CAPSULES_PER_USER = 100;
    
    /** 胶囊最大记忆条目数量 */
    public static final int MAX_ENTRIES_PER_CAPSULE = 50;
    /** 用户名最小长度 */
    public static final int USERNAME_MIN_LENGTH = 3;
    
    /** 用户名最大长度 */
    public static final int USERNAME_MAX_LENGTH = 20;
    
    /** 昵称最大长度 */
    public static final int NICKNAME_MAX_LENGTH = 30;
    
    /** 密码最小长度 */
    public static final int PASSWORD_MIN_LENGTH = 6;
    
    /** 密码最大长度 */
    public static final int PASSWORD_MAX_LENGTH = 20;
    
    /** 手机号长度 */
    public static final int PHONE_LENGTH = 11;
    /** 激活状态 */
    public static final Boolean ACTIVE_STATUS = true;
    
    /** 非激活状态 */
    public static final Boolean INACTIVE_STATUS = false;
    
    /** 删除状态 */
    public static final Boolean DELETED_STATUS = true;
    
    /** 未删除状态 */
    public static final Boolean NOT_DELETED_STATUS = false;
    /** 成功响应码 */
    public static final int SUCCESS_CODE = 200;
    
    /** 失败响应码 */
    public static final int ERROR_CODE = 500;
    
    /** 参数错误响应码 */
    public static final int PARAM_ERROR_CODE = 400;
    
    /** 未授权响应码 */
    public static final int UNAUTHORIZED_CODE = 401;
    
    /** 禁止访问响应码 */
    public static final int FORBIDDEN_CODE = 403;
    
    /** 资源未找到响应码 */
    public static final int NOT_FOUND_CODE = 404;
    /** 用户信息缓存前缀 */
    public static final String USER_CACHE_PREFIX = "user:";
    
    /** 胶囊信息缓存前缀 */
    public static final String CAPSULE_CACHE_PREFIX = "capsule:";
    
    /** 验证码缓存前缀 */
    public static final String VERIFICATION_CODE_PREFIX = "verification:";
    
    /** 访问令牌缓存前缀 */
    public static final String ACCESS_TOKEN_PREFIX = "access_token:";
    
    /** 刷新令牌缓存前缀 */
    public static final String REFRESH_TOKEN_PREFIX = "refresh_token:";
    
    /** 会话信息缓存前缀 */
    public static final String SESSION_CACHE_PREFIX = "session:";
    
    /** 配置信息缓存前缀 */
    public static final String CONFIG_CACHE_PREFIX = "config:";
    
    /** API限流缓存前缀 */
    public static final String RATE_LIMIT_PREFIX = "rate_limit:";
    /** 手机号正则表达式 */
    public static final String PHONE_REGEX = "^1[3-9]\\d{9}$";
    
    /** 邮箱正则表达式 */
    public static final String EMAIL_REGEX = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$";
    
    /** 用户名正则表达式（字母、数字、下划线） */
    public static final String USERNAME_REGEX = "^[a-zA-Z0-9_]{3,20}$";
    
    /** 密码正则表达式（至少包含字母和数字） */
    public static final String PASSWORD_REGEX = "^(?=.*[a-zA-Z])(?=.*\\d)[a-zA-Z\\d@$!%*?&]{6,20}$";
    
    /** 分享码正则表达式（8位字母数字） */
    public static final String SHARE_CODE_REGEX = "^[a-zA-Z0-9]{8}$";
    /** 支持的图片格式 */
    public static final String[] SUPPORTED_IMAGE_FORMATS = {
        "jpg", "jpeg", "png", "gif", "bmp", "webp"
    };
    
    /** 支持的音频格式 */
    public static final String[] SUPPORTED_AUDIO_FORMATS = {
        "mp3", "wav", "aac", "flac", "ogg", "m4a"
    };
    
    /** 支持的视频格式 */
    public static final String[] SUPPORTED_VIDEO_FORMATS = {
        "mp4", "avi", "mov", "wmv", "flv", "mkv", "webm"
    };
    
    /** 支持的文档格式 */
    public static final String[] SUPPORTED_DOCUMENT_FORMATS = {
        "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "txt"
    };
    /** 操作成功消息 */
    public static final String SUCCESS_MESSAGE = "操作成功";
    
    /** 操作失败消息 */
    public static final String ERROR_MESSAGE = "操作失败";
    
    /** 参数错误消息 */
    public static final String PARAM_ERROR_MESSAGE = "参数错误";
    
    /** 未授权消息 */
    public static final String UNAUTHORIZED_MESSAGE = "未授权访问";
    
    /** 禁止访问消息 */
    public static final String FORBIDDEN_MESSAGE = "禁止访问";
    
    /** 资源未找到消息 */
    public static final String NOT_FOUND_MESSAGE = "资源未找到";
    
    /** 数据不存在消息 */
    public static final String DATA_NOT_FOUND_MESSAGE = "数据不存在";
    
    /** 数据已存在消息 */
    public static final String DATA_EXISTS_MESSAGE = "数据已存在";
    
    /** 文件上传失败消息 */
    public static final String FILE_UPLOAD_ERROR_MESSAGE = "文件上传失败";
    
    /** 文件格式不支持消息 */
    public static final String FILE_FORMAT_ERROR_MESSAGE = "文件格式不支持";
    
    /** 文件大小超限消息 */
    public static final String FILE_SIZE_ERROR_MESSAGE = "文件大小超出限制";
    /** 登录日志类型 */
    public static final String LOG_TYPE_LOGIN = "LOGIN";
    
    /** 登出日志类型 */
    public static final String LOG_TYPE_LOGOUT = "LOGOUT";
    
    /** 创建日志类型 */
    public static final String LOG_TYPE_CREATE = "CREATE";
    
    /** 更新日志类型 */
    public static final String LOG_TYPE_UPDATE = "UPDATE";
    
    /** 删除日志类型 */
    public static final String LOG_TYPE_DELETE = "DELETE";
    
    /** 查询日志类型 */
    public static final String LOG_TYPE_QUERY = "QUERY";
    
    /** 上传日志类型 */
    public static final String LOG_TYPE_UPLOAD = "UPLOAD";
    
    /** 下载日志类型 */
    public static final String LOG_TYPE_DOWNLOAD = "DOWNLOAD";
    private AppConstants() {
    }
}